/**
 * @Author: 九璃怀特 1599130621@qq.com
 * @Date: 2023-12-21 17:04:38
 * @LastEditors: 九璃怀特 1599130621@qq.com
 * @LastEditTime: 2023-12-29 10:23:27
 * @FilePath: \zxi-surface-manual\src\composables\dark.ts
 * @Description:
 */
import { useDark, useToggle } from "@vueuse/core";

export const isDark = useDark({
  storageKey: "pm-theme-appearance",
});
export const toggleDark = useToggle(isDark);

(() => {
  const saved = localStorage.getItem("pm-theme-appearance");
  if (saved === "auto") {
    document.documentElement.classList.add("dark");
    toggleDark(true)
  }
})();
